import { useLocalStorageRef } from '@/hooks/useLocalStorageRef'
import type { RandomTestingStore } from '.'
import { RandomTestingConstants } from '../constants/RandomTesting'

export class PageConfigStore {
  constructor(rootStore: RandomTestingStore) {
    this.rootStore = rootStore
  }

  rootStore

  titleFontSize = useLocalStorageRef(24, RandomTestingConstants.localStorageId.titleFontSize)

  titleFontWeight = useLocalStorageRef(6, RandomTestingConstants.localStorageId.titleFontWeight)
  answerFontSize = useLocalStorageRef(14, RandomTestingConstants.localStorageId.answerFontSize)
  answerFontWeight = useLocalStorageRef(3, RandomTestingConstants.localStorageId.answerFontWeight)

  resetData = () => {
    this.titleFontSize.value = 24
    this.titleFontWeight.value = 6
    this.answerFontSize.value = 14
    this.answerFontWeight.value = 3
  }
}
